using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data;
using System.Web.Services.Protocols;
using VimApi;


namespace Wicresoft.EKA.VCenter
{
    /// <summary>
    /// useful Client utility functions.
    /// </summary>
    public class ClientUtil
    {

        private AppUtil _ci;
        // Create a logger for use in this class
        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        public ClientUtil(AppUtil c)
        {
            _ci = c;
        }

        public void LogException(Exception e)
        {
            if (e.GetType() == System.Type.GetType("SoapException"))
            {
                SoapException se = (SoapException)e;
                log.Error("Caught SoapException - " +
                   " Actor : " + se.Actor +
                   " Code : " + se.Code +
                   " Detail XML : " + se.Detail.OuterXml);
            }
            else
            {
                log.Error("Caught Exception : " +
                   " Name : " + e.GetType().Name +
                   " Message : " + e.Message +
                   " Trace : " + e.StackTrace);
            }
        }

    }
}
